From: Ximin Luo Date: Sat, 4 May 2024 11:38:10 +0000 (+0200) Subject: Disable network tests X-Git-Tag: archive/raspbian/1.72.1+dfsg1-1+rpi1~1^2^2~50 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=60af04c8d1969c7f9e522ba7543ba77b907e6d99;p=rustc.git Disable network tests Forwarded: TODO Forwarded: TODO Gbp-Pq: Name c-2002_disable-net-tests.patch --- diff --git a/src/tools/cargo/tests/testsuite/credential_process.rs b/src/tools/cargo/tests/testsuite/credential_process.rs index 8c202c6a3c..2dcb65403d 100644 --- a/src/tools/cargo/tests/testsuite/credential_process.rs +++ b/src/tools/cargo/tests/testsuite/credential_process.rs @@ -8,7 +8,7 @@ fn toml_bin(proj: &Project, name: &str) -> String { proj.bin(name).display().to_string().replace('\\', "\\\\") } -#[cargo_test] +#[allow(dead_code)] fn gated() { let _alternative = registry::RegistryBuilder::new() .alternative() @@ -65,7 +65,7 @@ or use environment variable CARGO_REGISTRIES_ALTERNATIVE_TOKEN .run(); } -#[cargo_test] +#[allow(dead_code)] fn warn_both_token_and_process() { // Specifying both credential-process and a token in config should issue a warning. let _server = registry::RegistryBuilder::new() @@ -212,7 +212,7 @@ fn get_token_test() -> (Project, TestRegistry) { (p, server) } -#[cargo_test] +#[allow(dead_code)] fn publish() { // Checks that credential-process is used for `cargo publish`. let (p, _t) = get_token_test(); @@ -237,7 +237,7 @@ You may press ctrl-c [..] assert_eq!(calls, 1); } -#[cargo_test] +#[allow(dead_code)] fn basic_unsupported() { // Non-action commands don't support login/logout. let registry = registry::RegistryBuilder::new() @@ -280,7 +280,7 @@ the credential-process configuration value must pass the \ .run(); } -#[cargo_test] +#[allow(dead_code)] fn login() { let server = registry::RegistryBuilder::new() .no_configure_token() @@ -337,7 +337,7 @@ fn login() { ); } -#[cargo_test] +#[allow(dead_code)] fn logout() { let server = registry::RegistryBuilder::new() .no_configure_token() @@ -395,7 +395,7 @@ token for `crates-io` has been erased! ); } -#[cargo_test] +#[allow(dead_code)] fn yank() { let (p, _t) = get_token_test(); @@ -410,7 +410,7 @@ fn yank() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn owner() { let (p, _t) = get_token_test(); @@ -425,7 +425,7 @@ fn owner() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn libexec_path() { // cargo: prefixed names use the sysroot let server = registry::RegistryBuilder::new() @@ -459,7 +459,7 @@ Caused by: .run(); } -#[cargo_test] +#[allow(dead_code)] fn invalid_token_output() { // Error when credential process does not output the expected format for a token. let _server = registry::RegistryBuilder::new() diff --git a/src/tools/cargo/tests/testsuite/git_auth.rs b/src/tools/cargo/tests/testsuite/git_auth.rs index b6e68fa3d8..e31fc46c09 100644 --- a/src/tools/cargo/tests/testsuite/git_auth.rs +++ b/src/tools/cargo/tests/testsuite/git_auth.rs @@ -103,7 +103,7 @@ fn setup_failed_auth_test() -> (SocketAddr, JoinHandle<()>, Arc) { } // Tests that HTTP auth is offered from `credential.helper`. -#[cargo_test] +#[allow(dead_code)] fn http_auth_offered() { // TODO(Seb): remove this once possible. if cargo_uses_gitoxide() { @@ -172,7 +172,7 @@ Caused by: } // Boy, sure would be nice to have a TLS implementation in rust! -#[cargo_test] +#[allow(dead_code)] fn https_something_happens() { let server = TcpListener::bind("127.0.0.1:0").unwrap(); let addr = server.local_addr().unwrap(); diff --git a/src/tools/cargo/tests/testsuite/net_config.rs b/src/tools/cargo/tests/testsuite/net_config.rs index 569ec552ca..27c4132077 100644 --- a/src/tools/cargo/tests/testsuite/net_config.rs +++ b/src/tools/cargo/tests/testsuite/net_config.rs @@ -2,7 +2,7 @@ use cargo_test_support::project; -#[cargo_test] +#[allow(dead_code)] fn net_retry_loads_from_config() { let p = project() .file( @@ -38,7 +38,7 @@ fn net_retry_loads_from_config() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn net_retry_git_outputs_warning() { let p = project() .file( diff --git a/src/tools/cargo/tests/testsuite/publish.rs b/src/tools/cargo/tests/testsuite/publish.rs index 00a79fe736..88785259cd 100644 --- a/src/tools/cargo/tests/testsuite/publish.rs +++ b/src/tools/cargo/tests/testsuite/publish.rs @@ -85,7 +85,7 @@ fn validate_upload_li() { ); } -#[cargo_test] +#[allow(dead_code)] fn simple() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -127,7 +127,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. // Check that the `token` key works at the root instead of under a // `[registry]` table. -#[cargo_test] +#[allow(dead_code)] fn simple_publish_with_http() { let _reg = registry::RegistryBuilder::new() .http_api() @@ -167,7 +167,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. .run(); } -#[cargo_test] +#[allow(dead_code)] fn simple_publish_with_asymmetric() { let _reg = registry::RegistryBuilder::new() .http_api() @@ -210,7 +210,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. .run(); } -#[cargo_test] +#[allow(dead_code)] fn old_token_location() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -267,7 +267,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn simple_with_index() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -312,7 +312,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn git_deps() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -350,7 +350,7 @@ the `git` specification will be removed from the dependency declaration. .run(); } -#[cargo_test] +#[allow(dead_code)] fn path_dependency_no_version() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -390,7 +390,7 @@ the `path` specification will be removed from the dependency declaration. .run(); } -#[cargo_test] +#[allow(dead_code)] fn unpublishable_crate() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -423,7 +423,7 @@ fn unpublishable_crate() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn dont_publish_dirty() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -465,7 +465,7 @@ to proceed despite this and include the uncommitted changes, pass the `--allow-d .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_clean() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -513,7 +513,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn publish_in_sub_repo() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -562,7 +562,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn publish_when_ignored() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -611,7 +611,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn ignore_when_crate_ignored() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -659,7 +659,7 @@ You may press ctrl-c [..] // Other tests will verify the endpoint gets the right payload. } -#[cargo_test] +#[allow(dead_code)] fn new_crate_rejected() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -692,7 +692,7 @@ fn new_crate_rejected() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn dry_run() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -735,7 +735,7 @@ See [..] assert!(!registry::api_path().join("api/v1/crates/new").exists()); } -#[cargo_test] +#[allow(dead_code)] fn registry_not_in_publish_list() { let p = project() .file( @@ -768,7 +768,7 @@ The registry `alternative` is not listed in the `package.publish` value in Cargo .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_empty_list() { let p = project() .file( @@ -797,7 +797,7 @@ fn publish_empty_list() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_allowed_registry() { let _registry = RegistryBuilder::new() .http_api() @@ -857,7 +857,7 @@ You may press ctrl-c [..] ); } -#[cargo_test] +#[allow(dead_code)] fn publish_implicitly_to_only_allowed_registry() { let _registry = RegistryBuilder::new() .http_api() @@ -918,7 +918,7 @@ You may press ctrl-c [..] ); } -#[cargo_test] +#[allow(dead_code)] fn publish_fail_with_no_registry_specified() { let p = project().build(); @@ -952,7 +952,7 @@ The registry `crates-io` is not listed in the `package.publish` value in Cargo.t .run(); } -#[cargo_test] +#[allow(dead_code)] fn block_publish_no_registry() { let p = project() .file( @@ -982,7 +982,7 @@ fn block_publish_no_registry() { } // Explicitly setting `crates-io` in the publish list. -#[cargo_test] +#[allow(dead_code)] fn publish_with_crates_io_explicit() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1035,7 +1035,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_select_features() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1086,7 +1086,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_all_features() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1137,7 +1137,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_no_default_features() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -1173,7 +1173,7 @@ fn publish_with_no_default_features() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_patch() { let registry = RegistryBuilder::new().http_api().http_index().build(); Package::new("bar", "1.0.0").publish(); @@ -1278,7 +1278,7 @@ You may press ctrl-c [..] ); } -#[cargo_test] +#[allow(dead_code)] fn publish_checks_for_token_before_verify() { let registry = registry::RegistryBuilder::new() .no_configure_token() @@ -1327,7 +1327,7 @@ fn publish_checks_for_token_before_verify() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_bad_source() { let p = project() .file( @@ -1376,7 +1376,7 @@ include `--registry crates-io` to use crates.io } // A dependency with both `git` and `version`. -#[cargo_test] +#[allow(dead_code)] fn publish_git_with_version() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -1519,7 +1519,7 @@ You may press ctrl-c [..] ); } -#[cargo_test] +#[allow(dead_code)] fn publish_dev_dep_no_version() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -1608,7 +1608,7 @@ repository = "foo" ); } -#[cargo_test] +#[allow(dead_code)] fn credentials_ambiguous_filename() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -1664,7 +1664,7 @@ You may press ctrl-c [..] // --index will not load registry.token to avoid possibly leaking // crates.io token to another server. -#[cargo_test] +#[allow(dead_code)] fn index_requires_token() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -1699,7 +1699,7 @@ fn index_requires_token() { } // publish with source replacement without --registry -#[cargo_test] +#[allow(dead_code)] fn cratesio_source_replacement() { registry::init(); let p = project() @@ -1728,7 +1728,7 @@ include `--registry dummy-registry` or `--registry crates-io` .run(); } -#[cargo_test] +#[allow(dead_code)] fn publish_with_missing_readme() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -1773,7 +1773,7 @@ Caused by: } // Registry returns an API error. -#[cargo_test] +#[allow(dead_code)] fn api_error_json() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -1821,7 +1821,7 @@ Caused by: } // Registry returns an API error with a 200 status code. -#[cargo_test] +#[allow(dead_code)] fn api_error_200() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -1869,7 +1869,7 @@ Caused by: } // Registry returns an error code without a JSON message. -#[cargo_test] +#[allow(dead_code)] fn api_error_code() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -1923,7 +1923,7 @@ Caused by: } // Registry has a network error. -#[cargo_test] +#[allow(dead_code)] fn api_curl_error() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -1973,7 +1973,7 @@ Caused by: } // Registry returns an invalid response. -#[cargo_test] +#[allow(dead_code)] fn api_other_error() { let _registry = registry::RegistryBuilder::new() .alternative() @@ -2023,7 +2023,7 @@ Caused by: .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -2074,7 +2074,7 @@ You may press ctrl-c [..] validate_upload_li(); } -#[cargo_test] +#[allow(dead_code)] fn with_duplicate_spec_in_members() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2126,7 +2126,7 @@ fn with_duplicate_spec_in_members() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace_with_members_with_features_old() { let registry = RegistryBuilder::new().http_api().http_index().build(); @@ -2176,7 +2176,7 @@ You may press ctrl-c [..] validate_upload_li(); } -#[cargo_test] +#[allow(dead_code)] fn in_virtual_workspace() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2212,7 +2212,7 @@ fn in_virtual_workspace() { .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_virtual_workspace_with_p() { // `publish` generally requires a remote registry let registry = registry::RegistryBuilder::new().http_api().build(); @@ -2269,7 +2269,7 @@ You may press ctrl-c [..] .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace_not_found() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2314,7 +2314,7 @@ error: package ID specification `li` did not match any packages .run(); } -#[cargo_test] +#[allow(dead_code)] fn in_package_workspace_found_multiple() { // Use local registry for faster test times since no publish will occur let registry = registry::init(); @@ -2371,7 +2371,7 @@ error: the `-p` argument must be specified to select a single package to publish .run(); } -#[cargo_test] +#[allow(dead_code)] // https://github.com/rust-lang/cargo/issues/10536 fn publish_path_dependency_without_workspace() { // Use local registry for faster test times since no publish will occur @@ -2418,7 +2418,7 @@ error: package ID specification `bar` did not match any packages .run(); } -#[cargo_test] +#[allow(dead_code)] fn http_api_not_noop() { let registry = registry::RegistryBuilder::new().http_api().build(); @@ -2479,7 +2479,7 @@ You may press ctrl-c [..] p.cargo("build").run(); } -#[cargo_test] +#[allow(dead_code)] fn wait_for_first_publish() { // Counter for number of tries before the package is "published" let arc: Arc> = Arc::new(Mutex::new(0)); @@ -2561,7 +2561,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. /// A separate test is needed for package names with - or _ as they hit /// the responder twice per cargo invocation. If that ever gets changed /// this test will need to be changed accordingly. -#[cargo_test] +#[allow(dead_code)] fn wait_for_first_publish_underscore() { // Counter for number of tries before the package is "published" let arc: Arc> = Arc::new(Mutex::new(0)); @@ -2657,7 +2657,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. p.cargo("build").with_status(0).run(); } -#[cargo_test] +#[allow(dead_code)] fn wait_for_subsequent_publish() { // Counter for number of tries before the package is "published" let arc: Arc> = Arc::new(Mutex::new(0)); @@ -2749,7 +2749,7 @@ You may press ctrl-c to skip waiting; the crate should be available shortly. p.cargo("check").with_status(0).run(); } -#[cargo_test] +#[allow(dead_code)] fn skip_wait_for_publish() { // Intentionally using local registry so the crate never makes it to the index let registry = registry::init();